import * as vscode from 'vscode';

export function getCompletionItems(): vscode.CompletionItem[] {
    const globals = [
        'assert', 'collectgarbage', 'dofile', 'error', 'getmetatable', 'ipairs',
        'load', 'loadfile', 'next', 'pairs', 'pcall', 'print', 'rawequal', 'rawget',
        'rawset', 'select', 'setmetatable', 'tonumber', 'tostring', 'type', 'xpcall', 'require'
    ];

    return globals.map(global => {
        const item = new vscode.CompletionItem(global, vscode.CompletionItemKind.Function);
        item.insertText = new vscode.SnippetString(global + '(${1})');
        item.documentation = new vscode.MarkdownString(`\`${global}\` function`);
        return item;
    });
}
